package cn.com.headfree.entity;
/**
 * @Title  TRecordOptLog.java
 * @Package cn.com.headfree.entity
 * @Description 业务记录操作日志信息
 * @author yangwang
 * @date  2020年7月3日 下午3:01:23
 */

import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.gta.edu.sdk.mybatis.common.Entity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class TRecordOptLog extends Entity implements Serializable {
	private static final Logger LOG = LogManager.getLogger(TRecordOptLog.class);

	/**
	 * @Fields serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	/*业务原始记录ID*/
	private String recordId;
	/*操作类型:jlczlx*/
	private String optType;
	/*操作类型名称*/
	private String optTypeName;
	/*操作人姓名*/
	private String optUserName;
	/*操作人ID*/
	private String optUserId;
	/*操作时间*/
	private Date optTime;
	/*操作时间*/
	private String optTimeStr;
	/*操作内容*/
	private String optContent;

	/**
	 * 业务当前记录ID
	 */
	private String currentRecordId;

	/**
	 * 审核状态(0：待审核，1：通过，2：不通过)
	 */
	private Integer optStatus;

	/* 时间格式化YMDHMS */
	private static ThreadLocal<DateFormat> YMDHMS = new ThreadLocal<DateFormat>() {
		@Override
	    protected DateFormat initialValue(){
	        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	    }
	};

	public String getRecordId() {
		return recordId;
	}
	public void setRecordId(String recordId) {
		this.recordId = recordId;
	}
	public String getOptType() {
		return optType;
	}
	public void setOptType(String optType) {
		this.optType = optType;
	}
	public String getOptTypeName() {
		return optTypeName;
	}
	public void setOptTypeName(String optTypeName) {
		this.optTypeName = optTypeName;
	}
	public String getOptUserName() {
		return optUserName;
	}
	public void setOptUserName(String optUserName) {
		this.optUserName = optUserName;
	}
	public String getOptUserId() {
		return optUserId;
	}
	public void setOptUserId(String optUserId) {
		this.optUserId = optUserId;
	}
	public Date getOptTime() {
		return optTime;
	}
	public void setOptTime(Date optTime) {
		this.optTime = optTime;
		if(null != optTime) {
			this.optTimeStr = YMDHMS.get().format(optTime);
		}
	}
	public String getOptTimeStr() {
		return optTimeStr;
	}
	public void setOptTimeStr(String optTimeStr) {
		this.optTimeStr = optTimeStr;
		if(StringUtils.isNotBlank(optTimeStr)) {
			try {
				this.optTime = YMDHMS.get().parse(optTimeStr);
			} catch (ParseException e) {
				LOG.error("时间字符串转换为时间异常", e);
			}
		}
	}
	public String getOptContent() {
		return optContent;
	}
	public void setOptContent(String optContent) {
		this.optContent = optContent;
	}

	public String getCurrentRecordId() {
		return currentRecordId;
	}

	public void setCurrentRecordId(String currentRecordId) {
		this.currentRecordId = currentRecordId;
	}

	public Integer getOptStatus() {
		return optStatus;
	}

	public void setOptStatus(Integer optStatus) {
		this.optStatus = optStatus;
	}
}
